{extend name='common@layout/seller' /}
{block name="left"}
  <div id="layoutLeft" class="ncsc-layout-left">
    <div id="sidebar" class="sidebar">
      <div class="column-title" id="main-nav"><span class="ico-index"></span>
        <h2>首页</h2>
      </div>
      <div class="column-menu" style='display: none;'>
        <ul id="seller_center_left_menu">
                              <div class="add-quickmenu"><a href="javascript:void(0);"><i class="icon-plus"></i>添加常用功能菜单</a></div>
                            </ul>
      </div>
    </div>
  </div>
{/block}
{block name="breadcrumb"}
    <div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right"></i>首页<i class="icon-angle-right"></i></div>
{/block}
{block name='content'}
<div class="ncsc-index">
  <div class="top-container">
    <div class="basic-info">
      <dl class="ncsc-seller-info">
        <dt class="seller-name">
          <h3><?php echo $store_info['seller_name']; ?></h3>
          <h5>(用户名：{$Think.config.member_info.name})</h5>
        </dt>
        <dd class="store-logo">
          <p><img alt="<?php echo $store_info['name'];?>" src="<?php echo img_url($store_info['label']);?>"/></p>
          <a href="<?php echo url('seller/store/setting');?>"><i class="icon-edit"></i>编辑店铺设置</a> </dd>
        <dd class="store-name">店铺名称：<a href="<?php echo url('index/store/index', array('store_id' => config('store_id')));?>" ><?php echo $store_info['name'];?></a></dd>
        <dd class="store-grade">店铺等级：<strong><?php echo $store_info['grade_name']; ?></strong></dd>
        <dd class="store-validity">有效期：<strong><?php echo $store_info['store_end_time_text'];?>
          <?php if ($store_info['reopen_tip']) {?>
          <a href="{:url('seller/store/reopen')}">马上续签</a>
          <?php } ?>
          </strong> </dd>
      </dl>
<?php if (!$isOwnShop) { ?>
      <div class="detail-rate">
        <h5> <strong>店铺动态评分：</strong> 与行业相比 </h5>
        <ul>
          <?php  foreach ($store_info['store_credit'] as $value) {?>
          <li> 
              <?php echo $value['text'];?>
              <span class="credit"><?php echo $value['credit'];?> 分</span> 
              <span class="<?php echo $value['percent_class'];?>">
                  <i></i><?php echo $value['percent_text'];?>
                  <em><?php echo $value['percent'];?></em>
              </span> 
          </li>
          <?php } ?>
        </ul>
      </div>
<?php } ?>
    </div>
  </div>
  <div class="seller-cont">
    <div class="container type-a">
      <div class="hd">
        <h3>店铺及商品提示</h3>
        <h5>您需要关注的店铺信息以及待处理事项</h5>
      </div>
      <div class="content">
        <dl class="focus">
          <dt>店铺商品发布情况：</dt>
          <dd title="已发布/可传商品"><em id="nc_goodscount">0</em>&nbsp;/&nbsp;
            <?php if ($store_info['grade_goodslimit'] != 0){ echo $store_info['grade_goodslimit'];} else { echo '不限';} ?>
          </dd>
          <dt>图片空间使用：</dt>
          <dd><em id="nc_imagecount">0</em>&nbsp;/&nbsp;<?php echo $store_info['grade_albumlimit'] > 0 ? $store_info['grade_albumlimit'] : '不限'; ?></dd>
        </dl>
        <ul>
          <li><a href="{:url('seller/goods/index')}">出售中 <strong id="nc_online"></strong></a></li>
          <?php if (config('goods_verify')) {?>
          <li><a href="index.php?act=store_goods_offline&op=index&type=wait_verify&verify=10" title="30天内举报记录数">发布待平台审核 <strong id="nc_waitverify"></strong></a></li>
          <li><a href="index.php?act=store_goods_offline&op=index&type=wait_verify&verify=0" title="30天内举报记录数">平台审核失败 <strong id="nc_verifyfail"></strong></a></li>
          <?php }?>
          <li><a href="{:url('seller/goods/offline')}">仓库中 <strong id="nc_offline"></strong></a></li>
          <!--
          <li><a href="index.php?act=store_goods_offline&op=index&type=lock_up">违规下架 <strong id="nc_lockup"></strong></a></li>
          <li><a href="index.php?act=store_consult&op=consult_list&type=to_reply">待回复咨询 <strong id="nc_consult"></strong></a></li>
          -->
        </ul>
      </div>
    </div>
    <div class="container type-b">
      <div class="hd">
        <h3>商家帮助</h3>
        <h5></h5>
      </div>
      <div class="content">
        <ul>{php}$guide = config("article_cate.seller_guide")['_child'];{/php}
              {foreach $guide as $one}
              <li>
                  <a target="_blank" href="{:url('index/store/guide?cate_id='.$one['id'])}" title="{$one.name}">{$one.name}</a>
              </li>
              {/foreach}</ul>
        <dl>
          <dt>平台联系方式</dt>
          {foreach $platform_contact as $one}<dd>{$one.name}：{$one.tag}</dd>{/foreach}
        </dl>
      </div>
    </div>
    <div class="container type-a">
      <div class="hd">
        <h3>交易提示</h3>
        <h5>您需要立即处理的交易订单</h5>
      </div>
      <div class="content">
        <dl class="focus">
          <dt>近期售出：</dt>
          <dd><a href="{:url('seller/order/index')}">交易中的订单 <strong id="nc_progressing"></strong></a></dd>
          <dt>维权提示：</dt>
          <dd><a href="#complain" onclick='return false'>收到维权投诉 <strong id="nc_complain"></strong></a></dd>
        </dl>
        <ul>
          <li><a href="{:url('seller/order/index?state_type=state_new')}">待付款 <strong id="nc_payment"></strong></a></li>
          <li><a href="{:url('seller/order/index?state_type=state_pay')}">待发货 <strong id="nc_delivery"></strong></a></li>
          <!--
          <li><a href="index.php?act=store_refund&lock=2"> 售前退款 <strong id="nc_refund_lock"></strong></a></li>
          <li><a href="index.php?act=store_refund&lock=1"> 售后退款 <strong id="nc_refund"></strong></a></li>
          <li><a href="index.php?act=store_return&lock=2"> 售前退货 <strong id="nc_return_lock"></strong></a></li>
          <li><a href="index.php?act=store_return&lock=1"> 售后退货 <strong id="nc_return"></strong></a></li>
          <li><a href="index.php?act=store_bill&op=index&bill_state=1"> 待确认账单 <strong id="nc_bill_confirm"></strong></a></li>
          -->
        </ul>
      </div>
    </div>
    <div class="container type-c">
      <div class="hd">
        <h3>销售情况统计</h3>
        <h5>按周期统计商家店铺的订单量和订单金额</h5>
      </div>
      <div class="content">
        <table class="ncsc-default-table">
          <thead>
            <tr>
              <th class="w50">项目</th>
              <th>订单量</th>
              <th class="w100">订单金额</th>
            </tr>
          </thead>
          <tbody>
            <tr class="bd-line">
              <td>昨日销量</td>
              <td><?php echo empty($sdaily_sales['ordernum']) ? '--' : $sdaily_sales['ordernum'];?></td>
              <td><?php echo empty($sdaily_sales['orderamount']) ? '--' : $lang['currency'].$sdaily_sales['orderamount'];?></td>
            </tr>
            <tr class="bd-line">
              <td>月销量</td>
              <td><?php echo empty($monthly_sales['ordernum']) ? '--' : $monthly_sales['ordernum'];?></td>
              <td><?php echo empty($monthly_sales['orderamount']) ? '--' : $lang['currency'].$monthly_sales['orderamount'];?></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div class="container type-c h500">
      <div class="hd">
        <h3>单品销售排名</h3>
        <h5>掌握30日内最热销的商品及时补充货源</h5>
      </div>
      <div class="content">
        <table class="ncsc-default-table">
          <thead>
            <tr>
              <th>排名</th>
              <th class="tl" colspan="2">商品信息</th>
              <th>销量</th>
            </tr>
          </thead>
          <tbody>
            <?php if ($goods_list) {?>
            <?php  
            $i = 0;
            foreach ($goods_list as $val) {
            $i++;
            ?>
            <tr class="bd-line">
              <td class="w50"><strong><?php echo $i;?></strong></td>
              <td class="w60"><div class="pic-thumb"><a href="<?php echo url('index/goods/detail', array('goods_id' => $val['goods_id']))?>" target="_blank"><img alt="<?php echo $val['goods_name'];?>" src="<?php echo img_url($val['goods_image'], 60);?>"></a></div></td>
              <td><dl class="goods-name">
                  <dt><a href="<?php echo url('index/goods/detail', array('goods_id' => $val['goods_id']))?>" target="_blank"><?php echo $val['goods_name'];?></a></dt>
                </dl></td>
              <td class="w60"><?php echo $val['goodsnum'];?></td>
            </tr>
            <?php }?>
            <?php }?>
          </tbody>
        </table>
      </div>
    </div>
    <div class="container type-d h500"><!--to do 店铺推广--></div>
  </div>
</div>
<script>
$(function(){
	var timestamp=Math.round(new Date().getTime()/1000/60);
    $.getJSON('/index.php?s=seller/index/statistics&rand='+timestamp, null, function(data){
        if (data == null) return false;
        for(var a in data) {
            if(data[a] != 'undefined' && data[a] != 0) {
                var tmp = '';
                if (a != 'goodscount' && a != 'imagecount') {
                    $('#nc_'+a).parents('a').addClass('num');
                }
                $('#nc_'+a).html(data[a]);
            }
        }
    });
});
</script>
{/block}